<template>
  <div id="home-swiper">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item,index) in imgList" :key='index'>
        <img :src="item.image_src">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>

import Vue from 'vue';
import { Swipe, SwipeItem } from 'vant';
import 'vant/lib/swipe/style'
import 'vant/lib/swipe-item/style'
Vue.use(Swipe);
Vue.use(SwipeItem);

export default {
  name:"HomeSwiper",
  data(){
    return {
      imgList:[]
    }
  },
  created() {
    this.$http({
      url:"/api/public/v1/home/swiperdata",
      methods:"get"
    }).then(res => {
      this.imgList = res.data.message
    })
  },
}
</script>

<style scoped>
  .my-swipe .van-swipe-item img {
    width: 100%;
  }
</style>